<?php
session_start();
$currentuser=isset($_SESSION["user"])?$_SESSION["user"]:null;
if(!$currentuser){
    echo "<a href='login.php'>请先登录</a>";
}else {

?>

<html>
<head>
<title>新添文章</title>
<meta http-equiv="Content-type" content="text/html;charset=utf-8">
</head>
<body><form action="do_article.php" method="POST">
   <div>
   当前用户：<a><?=$currentuser["username"]?></a>
   </div>
    <form action ="do_articel" method="POST">
    <div>
    <label>标题<label>
    <input type="text" name="title" value=""/>
    </div>
    <div>
    <label>内容</label>
    <textarea name="content" cols="80" rows="20"></textarea>
    </div>
    <div>
    <input type="submit" value="发布"/>
    <input type="reset" value="重置"/>
    <div>
    </from>
</body>
</html>
<?php }?>